package com.puff.controller.platform;

import com.puff.dto.OrdersPageQueryDTO;
import com.puff.dto.PlatformOrdersPageQueryDTO;
import com.puff.result.PageResult;
import com.puff.result.Result;
import com.puff.service.OrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("platformOrderController")
@RequestMapping("/platform/order")
@Slf4j
@Api(tags = "订单管理相关接口")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 平台端订单搜索
     * @param platformOrdersPageQueryDTO
     * @return
     */
    @GetMapping("/conditionSearch")
    @ApiOperation("平台端订单搜索")
    public Result<PageResult> conditionSearchWithPlatform(PlatformOrdersPageQueryDTO platformOrdersPageQueryDTO){
        log.info("平台端订单搜索：{}",platformOrdersPageQueryDTO);
        PageResult pageResult = orderService.conditionSearchWithPlatform(platformOrdersPageQueryDTO);
        return Result.success(pageResult);
    }
}
